<?php
class Admincp extends Admin_Controller{
	public function __construct(){
		parent::__construct();
	}	
	public function index(){
		redirect(base_url().'admincp/dashboard');
	}

	public function change_lang(){
		if($this->input->is_ajax_request()){
			$lang = $this->input->post('lang');
			$this->session->unset_userdata('curent_language');
			$data['curent_language'] = array('code' => $lang);
			$this->session->set_userdata($data);
		}
	}

	public function server(){
		$app_key = '64c050279d17bbe5b54b';
		$app_secret = 'e1d16de1b35b0edb841c';
		$app_id = '62637';

		$time = date('Y-m-d H:i:s');

		$pusher = new Pusher($app_key, $app_secret, $app_id);
		$data = array('time' => $time);
		$pusher->trigger('update-time', 'event-update', $data);

		$this->output->set_output($time);
	}

	public function client(){

    	$data['template']="admincp/admincp/client";
    	$data['title_page']='test realtime';
		$this->load->view("admincp/template",$data);
	}
}